package org.xxpay.apibase.service;

import com.alibaba.fastjson.JSONObject;
import org.xxpay.apibase.vo.ApiPayOrder;

public interface IAPIOrderService {

    
    /*
     * 功能描述: 更新订单状态:  支付中 --》 成功
     *
     * @param payOrderId 订单号
     * @param channelOrderNo 渠道订单号  (可为空)
     * @Return: void
     * @Author: xxpay
     */
    void updateOrderIng2Success(String payOrderId, String channelOrderNo);


    /*
     * 功能描述: 更新订单状态:  准备状态 --》 支付中
     *
     * @param payOrderId 订单号
     * @param channelOrderNo 渠道订单号 (可为空)
     * @Return: void
     * @Author: xxpay
     */
    void updateOrderReady2Ing(String payOrderId, String channelOrderNo);


    /*
     * 功能描述:  根据payOrderId查询订单
     *
     * @param payOrderId
     * @Return: org.xxpay.apibase.vo.ApiPayOrder
     * @Author: xxpay
     * @Date: 2020/9/18 17:26
     */
    ApiPayOrder getByPayOrderId(String payOrderId);


    /*
     * 功能描述: 根据订单ID 查询配置信息
     *
     * @param payOrderId
     * @Return: com.alibaba.fastjson.JSONObject
     * @Author: xxpay
     */
    JSONObject getPayParamJSONByOrderId(String payOrderId);


    /*
     * 功能描述:  通知订单到下游商户
     *
     * @param payOrderId
     * @Return: org.xxpay.apibase.vo.ApiPayOrder
     * @Author: xxpay
     * @Date: 2020/9/18 17:26
     */
    void notifySuccess2SubMch(String payOrderId);

    /***
     * 封装同步跳转地址
     * @param payOrderId
     * @return
     * @Author: xxpay
     * @Date: 2020/10/24 14:35
     */
    String genReturnUrlByOrderId(String payOrderId);

    /*
     * 存入订单跳转路径
     * @param payOrderId    订单号
     * @param topayUrl      统一跳转地址
     * @return
     */
    int saveTopayUrl(String payOrderId, String topayUrl);
}
